<!DOCTYPE html>
<html>
<head>
  <title>Bootstrap instance</title>
  <meta charset="utf-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css"/>  
  <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
  <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  <script type="text/javascript">
    function getConnectInfo() {
        var data = "clientId="+document.getElementById("ClientIdField").value;
        $.ajax({
            type:"get",
            url:"http://localhost/getConnectInfo",
            data:data,
            dataType: "json",
            success: function(result){
                var html = '<table class="table">';
                for (var index in result) {
                    var obj = result[index];
                    html += '<tr>';
                    html += '<td>' + obj.clientId + '</td>';
                    html += '<td>' + obj.time + '</td>';
                    html += '<td>' + obj.node + '</td>';
                    html += '</tr>';
                }
                html += '</table>';
                
                document.getElementById("treeList").innerHTML = html;
            }
        });
    }
  </script>
</head>
<body>
<h2>Hello World! I am home</h2>

<div class="col-sm-5">
  <input id="ClientIdField" type="text" class="form-control"/>
</div>
<div class="col-sm-5">
  <button class="btn btn-primary" onclick="getConnectInfo()">查询</button>
</div>
<div class="panel panel-default col-sm-10">
    <div class="panel-heading">查询结果</div>
    <div id='treeList'></div>
</div>
</body>
</html>
